package com.luban.hs.listener;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import org.springframework.web.context.support.ServletRequestHandledEvent;

/**
 * @Author: hs
 * @Description:
 * @Date: Create in 22:15 2019/2/2
 */
@Component
public class MyApplicationListener implements ApplicationListener<ServletRequestHandledEvent> {

    @Override
    public void onApplicationEvent(ServletRequestHandledEvent servletRequestHandledEvent) {
        //事件侦听是同步的...
        System.out.println("订阅事件"+servletRequestHandledEvent.getRequestUrl());
    }
}
